// 私有变量
function Person(name){
    var _name = name;
    this.getName = function(){
        console.log(_name)
    }
}

// 不能通过实例化对象获取_name
const x = Symbol("x");

export default class A{
    constructor(a){
        this[x] = a
    }

    showX(){
        return this[x]
    }
}

// 闭包
const A = (function(){
    let _x;
    class A {
        constructor(x){
            _x = x
        }

        showX(){
            return _x
        }
    } 
    return A
})()

